package com.hsnn.medstgmini.base.dict.model;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * DicHosptypeLog entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "dic_hosptype_log")
public class DicHosptypeLog implements java.io.Serializable {

	// Fields

	private String logId;
	private String hospTypeId;
	private String hospTypeCode;
	private String hospType;
	private String fatherId;
	private Short status;
	private Timestamp updDatetime;
	private String updUser;
	private Short sortId;


	private DicHosptype fatherType;
	// Constructors

	/** default constructor */
	public DicHosptypeLog() {
	}

	/** minimal constructor */
	public DicHosptypeLog(String hospTypeId, String hospTypeCode,
			String hospType) {
		this.hospTypeId = hospTypeId;
		this.hospTypeCode = hospTypeCode;
		this.hospType = hospType;
	}

	/** full constructor */
	public DicHosptypeLog(String hospTypeId, String hospTypeCode,
			String hospType, String fatherId, Short status,
			Timestamp updDatetime, String updUser, Short sortId) {
		this.hospTypeId = hospTypeId;
		this.hospTypeCode = hospTypeCode;
		this.hospType = hospType;
		this.fatherId = fatherId;
		this.status = status;
		this.updDatetime = updDatetime;
		this.updUser = updUser;
		this.sortId = sortId;
	}

	// Property accessors
	@GenericGenerator(name = "DicHosptypeLogGenerator", strategy = "uuid")
	@Id
	@GeneratedValue(generator = "DicHosptypeLogGenerator")
	@Column(name = "log_id", unique = true, nullable = false, length = 36)
	public String getLogId() {
		return this.logId;
	}

	public void setLogId(String logId) {
		this.logId = logId;
	}

	@Column(name = "hosp_type_id", nullable = false, length = 36)
	public String getHospTypeId() {
		return this.hospTypeId;
	}

	public void setHospTypeId(String hospTypeId) {
		this.hospTypeId = hospTypeId;
	}

	@Column(name = "hosp_type_code", nullable = false, length = 10)
	public String getHospTypeCode() {
		return this.hospTypeCode;
	}

	public void setHospTypeCode(String hospTypeCode) {
		this.hospTypeCode = hospTypeCode;
	}

	@Column(name = "hosp_type", nullable = false, length = 100)
	public String getHospType() {
		return this.hospType;
	}

	public void setHospType(String hospType) {
		this.hospType = hospType;
	}

	@Column(name = "father_id", length = 36,insertable = false,updatable = false)
	public String getFatherId() {
		return this.fatherId;
	}

	public void setFatherId(String fatherId) {
		this.fatherId = fatherId;
	}

	@Column(name = "status")
	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	@Column(name = "upd_datetime", length = 19)
	public Timestamp getUpdDatetime() {
		return this.updDatetime;
	}

	public void setUpdDatetime(Timestamp updDatetime) {
		this.updDatetime = updDatetime;
	}

	@Column(name = "upd_user", length = 36)
	public String getUpdUser() {
		return this.updUser;
	}

	public void setUpdUser(String updUser) {
		this.updUser = updUser;
	}

	@Column(name = "sort_id")
	public Short getSortId() {
		return this.sortId;
	}

	public void setSortId(Short sortId) {
		this.sortId = sortId;
	}
	
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER)
	@JoinColumn(name="father_id")
	public DicHosptype getFatherType() {
		return fatherType;
	}
	
	public void setFatherType(DicHosptype fatherType) {
		this.fatherType = fatherType;
	}
}